import API from '@/services/api'
import {request, METHOD, removeAuthorization} from '@/utils/request'

/**
 * 登录
 * @param params 请求参数
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function login(params) {
  return request(API.LOGIN, METHOD.POST, params)
}

/**
 * 退出登录
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function logout() {
  return request(API.LOGOUT, METHOD.POST)
}

/**
 * 获取路由菜单
 * @returns {Promise<AxiosResponse<T>>}
 */
export async function getRoutes() {
  return request(API.GET_ROUTES, METHOD.POST)
}

export default {
  login,
  logout,
  getRoutes
}
